//============================================================================
// Name        : Rcally.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include "Cally.h"
#include "Packet.h"
#include "CallyWrapper.h"

#include <unistd.h>
#include <stdio.h>
#include <pthread.h>

int main()
{
	Cally * CallyInst = Cally::GetInstance();
	CallyWrapper * Wrapper = new CallyWrapper();

	printf("Start up Cally!\n");

	int Res = 0;

	if ((Res = CallyInst->Initialize(0)) != CALLY_OK)
	{
		printf("Cally init error: %i\n", Res);
		return -1;
	}

	sleep(1);

	Wrapper->Initialize();

	pthread_join(CallyInst->CallyThreadId, NULL);

	CallyInst->Finalize();
	delete(Wrapper);

	printf("Bye bye!\n");

	return 0;
}
